package com.ghy.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @author GaoHeYang
 */
@Schema(name ="角色添加DTO")
@Data
public class RoleInsertDTO implements Serializable {

    @NotEmpty(message = "标题不能为空")
    @Size(min = 1,max = 42,message = "长度必须在1~42之间")
    @Schema(description = "标题")
    private String title;

    @NotEmpty(message="描述不能为空")
    @Size(min = 1,max = 170,message ="描述长度必须在1~170之间")
    @Schema(description = "描述")
    private String info;

    @NotNull(message="序号不能为空")
    @Range(min = 0,message="序号最小为θ")
    @Schema(description = "序号")
    private Long idx;

}
